#include "mysql_op.h"

int getUsrId(char *username)
{
    int usrid = -1;
    OPEN_MYSQL(myconnect);
    char *query = "SELECT id FROM user WHERE username = ";
    char sqlarray[1024] = {0};
    sprintf(sqlarray, "%s\"%s\"", query, username);
    printf("sqlarray = %s\n", sqlarray);
    mysql_query(&myconnect, sqlarray);
    MYSQL_RES *result = mysql_store_result(&myconnect);
    MYSQL_ROW row = mysql_fetch_row(result);
    usrid = atoi(row[0]);
    mysql_free_result(result);
    CLOSE_MYSQL(myconnect);
    return usrid;
}

void InsertVirtualFile(char* filename,int owner_id,char* md5,int filesize,int type)
{
    
}